<?php
$field_arr=$_POST['info'];
$id=$field_arr['id'];
$arr=array('id');
$field_arr=arr_diff($field_arr,$arr);
$field_arr=empty2zero($field_arr,array('sort'));

if($id=='')
{
	$field_arr['time']=date('Y-m-d H:i:s');
    insert_one_sql($table,$field_arr,0);
}
else
{
	$info=sel_sql($table, "hart,dduserid", "id=$id");
	$hart=$field_arr['hart']-$info['hart'];
    update_sql($table,$field_arr,"id=$id",0,0);
	update_sql('user',array('hart'=>$hart),"id=".$info['dduserid'],1,0);
}

echo alert('保存成功');
?>
